﻿<UserControl x:Class="Majesty_of_Omega.GUI.Pages.Game.Research.Parts.TechnicalInformationPart"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:Controls="clr-namespace:Majesty_of_Omega.GUI.Controls"
	xmlns:ValueConverters="clr-namespace:Majesty_of_Omega.GUI.ValueConverters" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
	xmlns:Config="clr-namespace:Majesty_of_Omega.Config;assembly=Majesty_of_Omega_BL" mc:Ignorable="d" 
	d:DesignWidth="493.35" 
	Height="Auto" x:Name="userControl" 
    >
    <UserControl.Resources>
        <ValueConverters:TechIconToImageConverter x:Key="TechIconToImageConverter"/>
	    <ObjectDataProvider x:Key="SpreadSheetManagerDS" ObjectType="{x:Type Config:SpreadSheetManager}"/>
    </UserControl.Resources>

	<Grid>
    <Controls:SetupPanelControl Style="{DynamicResource SubPanelLook}" Header="Technical Application Information" 
                                                x:Name="TechAppInfoPanel" Location="Right" >
        <Controls:SetupPanelControl.Background>
            <SolidColorBrush Color="{DynamicResource TechInfoColor}"/>
        </Controls:SetupPanelControl.Background>
        <Grid>
        	<Grid.ColumnDefinitions>
        		<ColumnDefinition Width="121"/>
        		<ColumnDefinition Width="*"/>
        	</Grid.ColumnDefinitions>
        	<Grid.RowDefinitions>
        		<RowDefinition Height="64"/>
        		<RowDefinition Height="*"/>
        	</Grid.RowDefinitions>
            <Image VerticalAlignment="Top" Height="Auto" Stretch="Uniform" 
                                   Source="{Binding Path=IconName, Converter={StaticResource TechIconToImageConverter}, Mode=Default}" HorizontalAlignment="Left" Margin="12,8,8,8" x:Name="TechInfoIcon" OpacityMask="{x:Null}"/>
            <StackPanel TextBlock.Foreground="Black" Margin="0,8,12,0" VerticalAlignment="Stretch" Height="Auto" Grid.Column="1">
            	<TextBlock x:Name="TechInfoName" Text="{Binding Path=Name}" TextWrapping="Wrap" Foreground="#FF000000" FontSize="14" FontWeight="Bold" />
            	<TextBlock FontSize="12" Text="Field Required:"/>
            	<ItemsControl TextBlock.FontSize="12" Width="Auto" Height="Auto" ItemsSource="{Binding Path=TechFieldDependencies}" x:Name="FieldDependencies"/>
            </StackPanel>
            <Grid Margin="12,0,12,8" Grid.ColumnSpan="2" Grid.Row="1" x:Name="InformationGrid">
            	<Grid.RowDefinitions>
            		<RowDefinition Height="*"/>
            		<RowDefinition Height="Auto" MinHeight="45.093"/>
            	</Grid.RowDefinitions>
            	<Controls:SetupPanelControl Style="{DynamicResource SubPanelLook}" Header="Information" Panel.ZIndex="-1" Location="Right" Grid.RowSpan="1" Grid.ColumnSpan="2" x:Name="InformationPanel">
            		<Controls:SetupPanelControl.Background>
            			<SolidColorBrush Color="#FFC7D8FC"/>
            		</Controls:SetupPanelControl.Background>
            		<Controls:MooTextBlock Width="Auto" Height="Auto" RichText="{Binding Path=Description, Mode=Default}" TextWrapping="Wrap" x:Name="TechInfoDescription" Margin="4,12,4,12" Foreground="#FF000000"/>
            	</Controls:SetupPanelControl>
            	<Grid x:Name="FundingLevelGrid" Margin="0,0,0,0" Grid.ColumnSpan="2" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Center" Visibility="Visible">
            		<TextBlock Text="Funding Level" Margin="0,3,0,3" d:LayoutOverrides="Height" Foreground="#FF000000" />
            		<ComboBox x:Name="FundingLevelCombobox"
                              HorizontalAlignment="Stretch" Margin="126.781,0,0,0" 
                              IsSynchronizedWithCurrentItem="True" d:LayoutOverrides="Height"
                              DisplayMemberPath="Label"
                              ItemsSource="{Binding Path=ResearchConfiguration.FundingLevels, Mode=Default, Source={StaticResource SpreadSheetManagerDS}}" 
                              SelectedValue="{Binding Path=FundingLevel, ElementName=userControl, Mode=Default}" 
							  SelectedValuePath="FundingLevel"
                              />
            	</Grid>
            </Grid>
        </Grid>
    </Controls:SetupPanelControl>
	</Grid>
</UserControl>
